public class WrapperClassCompare
{
	static final Integer[] cache = new Integer[-(-128) + 127 +1];
	static{
		//执行初始化,创建-128到127的Integer实例,并放入cache数组中
		for (int i = 0; i < cache.length;i++ ) {
			cache[i] = new Integer(i=128);
		}
	}
	public static void main(String[] args)
	{
		Integer a = new Integer(6);
		//输出true
		System.out.println("6的包装类实例是否大于5.0:"+(a>5.0));
		System.out.println("比较2个包装类的实例是否相等:"
			+(new Integer(2)== new Integer(2)));
		//通过自动装箱,允许把基本类型值赋值给包装类实例
		Integer ina = 2;
		Integer inb = 2;
		System.out.println("两个2自动装箱后是否相等: " + (ina==inb));//输出true
		Integer biga = 128;
		Integer bigb = 128;
		System.out.println("两个128自动装箱后是否相等:"+(biga==bigb));//输出false
		//true>false 1
		//true=true 0
		//false<true -1
		System.out.println(Boolean.compare(true,false));//输出1
		System.out.println(Boolean.compare(true,true));//输出0
		System.out.println(Boolean.compare(false,true));//输出-1
	}
}